package i18n

import (
	"github.com/nicksnyder/go-i18n/v2/i18n"
	"golang.org/x/text/language"
	"gopkg.in/yaml.v3"
	mi18n "miomp-terminal-suite/backend/i18n"
)

func Init() {
	mi18n.Bundle = i18n.NewBundle(language.Chinese)
	mi18n.Bundle.RegisterUnmarshalFunc("yaml", yaml.Unmarshal)
	_, _ = mi18n.Bundle.LoadMessageFileFS(mi18n.Fs, "lang/zh.yaml")
	_, _ = mi18n.Bundle.LoadMessageFileFS(mi18n.Fs, "lang/en.yaml")
	_, _ = mi18n.Bundle.LoadMessageFileFS(mi18n.Fs, "lang/zh-Hant.yaml")
}
